/*
 * @Copyright: 2025 Copyright (C) AMCAX, All rights reserved.
 * @Author: Zhang
 * @Date: 2025/7/24 19:39
 * @LastEditTime: 2025/7/24 19:39
 * @LastEditors: Zhang
 * @Description:
 */

import { ICommandLayout, TCmdGroup } from '@/components/types';
import { FeatureManager } from '@amcax/base';
import { Flex } from 'antd';
import { CmdButton } from '@/components/CmdBar/CmdButtons';
import {
  cmdAccuracyAnalysis,
  cmdFittingError,
  cmdDeformationError,
  cmdRemovalShape,
} from '@/commands/surfaceAnalysis';
const EditLayout = () => {
  return (
    <Flex>
      {FeatureManager.isFeatureEnabled('cmd-accuracy-analysis') && (
        <CmdButton cmd={cmdAccuracyAnalysis} />
      )}
      {FeatureManager.isFeatureEnabled('cmd-fitting-error') && (
        <CmdButton cmd={cmdFittingError} />
      )}
      {FeatureManager.isFeatureEnabled('cmd-deformation-error') && (
        <CmdButton cmd={cmdDeformationError} />
      )}
      {FeatureManager.isFeatureEnabled('cmd-removal-shape') && (
        <CmdButton cmd={cmdRemovalShape} />
      )}
    </Flex>
  );
};

const cmdGroups: TCmdGroup[] = [
  {
    id: 'draw',
    label: '编辑',
    layout: <EditLayout />,
    visible: true,
  },
];

export const surfaceAnalysis: ICommandLayout = {
  id: 'surfaceAnalysis',
  label: '曲面分析',
  cmds: cmdGroups,
};
